const express = require("express");
const r = express.Router();
// request 请求模块
const request = require("request");
let swaggerData;
// 获取swagger 接口地址
r.get("/", (req, res, next) => {
/**
 * 获取 swagger接口列表
 */
  let options = {
    url: "https://gateway-platform.xxx.com/swagger/v2/api-docs",
    method: "GET"
  };

  request(options, (err, response, body) => {
    if (err) {
        next(err)
        return
    }
  res.send({
      code: 200,
      data: body
    });
  });
});

module.exports = r;
